package com.zndroid.nfc.core;

import android.content.Intent;

import androidx.annotation.NonNull;

import com.zndroid.nfc.IAdapter;
import com.zndroid.nfc.NFC;

/**
 * Created by lzy on 2021/9/9.
 * 根据不同类型的卡，具体实现协议处理
 */
public interface IProtocol {
    /**
     * the devices is impl of 'NDEF' format
     * @param intent received intent
     * @param adapter call back
     * */
    void consumeNdef(@NonNull Intent intent, @NonNull IAdapter adapter);
    /**
     * the devices is impl of 'TECH' format
     * @param intent received intent
     * @param adapter call back
     * */
    void consumeTech(@NonNull Intent intent, @NonNull IAdapter adapter);
    /**
     * the devices is impl of 'TAG' format
     * @param intent received intent
     * @param adapter call back
     * */
    void consumeTag(@NonNull Intent intent, @NonNull IAdapter adapter);

    /** log info*/
    default void logI(String key, String value) {
        NFC.getInstance().logI(key, value);
    }
    /** log warning*/
    default void logW(String key, String value) {
        NFC.getInstance().logW(key, value);
    }
    /** log error*/
    default void logE(String key, String value) {
        NFC.getInstance().logE(key, value);
    }

}
